#!/bin/sh

echo 'start check your code，please wait...'
# git diff 获取更改的内容 可以通过参数--diff-filter 配置条件
npx eslint $(git diff --cached --name-only --diff-filter=ACM -- '*.ts')
# 变量$?--->上一个命令的执行状态结果
if [ $? != '0' ];then
  echo "ending and failed，please check your code；"
  exit 1
else
  echo "check pass"
fi
